//time the led stay high (in ms);
int hightime = 10;

void calculateStrobeMode(const int* hsvin, int* hsvout, float strobefreq){
  
  hsvout[0] = hsvin[0];
  hsvout[1] = hsvin[1];
  
  bool pulse = false;
  //float period = millis() % T;
  strobefreq *= 4;
  strobefreq += 0.05;
  
  float timeStrobe = max(0.95,min(0.95, strobefreq - 0.1));
  timeStrobe = 0.99;
  
  if (cos(millis() / (100 * strobefreq) ) > timeStrobe){
    pulse = true;
  } else {
     pulse = false; 
  }
  
  Serial.print("freq : ");
Serial.println(strobefreq);
Serial.print("timestrobe ");
Serial.println(timeStrobe);  
  //if ( period >= 0 && period <= hightime ) pulse = true;
  
  if(pulse){
    hsvout[2] = 100;
  } else {
    hsvout[2] = 0;
  }
}
